#ifndef __WIZ_INTERLOCKED_HPP__SHANHAOBO_19800429__
#define __WIZ_INTERLOCKED_HPP__SHANHAOBO_19800429__

#include "../Base/WizBase.hpp"

namespace Wiz
{
    namespace Interlocked
    {
#if (WIZ_CFG_PLATFORM == WIZ_CFG_PLATFORM_WINDOWS)
        WIZ_INLINE LONG Increment(LONG volatile* Trgt)
        {
            return InterlockedIncrement(Trgt);
        }
        WIZ_INLINE LONG Decrement(LONG volatile* Trgt)
        {
            return InterlockedDecrement(Trgt);
        }
        WIZ_INLINE LONG CompareExchange(LONG volatile* Trgt, LONG Cmpr, LONG Swp)
        {
            return InterlockedCompareExchange(Trgt, Swp, Cmpr);
        }
        WIZ_INLINE LONG Exchange(LONG volatile* Trgt, LONG Swp)
        {
            return InterlockedExchange(Trgt, Swp);
        }
        WIZ_INLINE LONG Add(LONG volatile* Trgt, LONG Val)
        {
            return InterlockedExchangeAdd(Trgt, Val);
        }
        WIZ_INLINE PVOID CompareExchangePointer(PVOID volatile* Trgt, PVOID Cmpr, PVOID Swp)
        {
            return InterlockedCompareExchangePointer(Trgt, Swp, Cmpr);
        }
        WIZ_INLINE PVOID ExchangePointer(PVOID volatile* Trgt, PVOID Swp)
        {
            return InterlockedExchangePointer(Trgt, Swp);
        }
#else
        
#endif /**/
    } /// end of namespace Interlocked
} /// end of namespace Wiz

#endif /*__WIZ_INTERLOCKED_HPP__SHANHAOBO_19800429__*/
